package com.example.c94s3plyspringboot.po;

import lombok.Data;
import lombok.NonNull;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.util.List;

@Data
public class User {

    private Integer id;
    @NotNull
    private String name;
    // 判断空字符串
    @NotEmpty(message = "密码不能为空")
    private String pwd;
    @Email
    private String email;
    @Pattern(regexp = "1\\d{10}")
    private String phone;
    @Max(150)
    @Min(0)
    @Range(min=0,max=150)
    private Integer age;

    public User() {
    }

    public User(String name, String pwd) {
        this.name = name;
        this.pwd = pwd;
    }

    private User friend;

    private List<User> friendList;
}
